<template>
    <div class="comments">
       <div class="top">
           <h2>预约核酸检测</h2>
           <div class="topright">
               <div class="import">导入</div>
               <div class="out">导出</div>
           </div>
       </div>
       <div class="allnumber">
           <div class="alltop">
               <div class="select">
                   <el-radio v-model="radio" label="1">全部</el-radio>
                   <el-radio v-model="radio" label="2">待检测</el-radio>
                   <el-radio v-model="radio" label="3">已完成</el-radio>
                   <el-radio v-model="radio" label="4">已退款</el-radio>
               </div>
               <div class="block">
                   <el-date-picker v-model="value1" type="daterange" range-separator="～" start-placeholder="请选择日期"  end-placeholder="请选择日期">
                   </el-date-picker>
                   <div class="button">搜索</div>
               </div>
           </div>
           <div class="alltable">
            <el-table
                   ref="multipleTable"
                   :data="tableData"
                   tooltip-effect="dark"
                   style="width: 100%"
                   @selection-change="handleSelectionChange">
                   <el-table-column
                   type="selection"
                   width="55">
                   </el-table-column>
                   <el-table-column
                    prop="name"
                   label="患者姓名"
                   width="70">
                   </el-table-column>
                   <el-table-column
                   prop="card"
                   label="就诊卡号"
                   width="90">
                   </el-table-column>
                   <el-table-column
                   prop="bodycard"
                   label="身份证号"
                   width="145">
                   </el-table-column>
                   <el-table-column
                   prop="phone"
                   label="手机号码"
                   width="105">
                   </el-table-column>
                   <el-table-column
                   prop="home"
                   label="科室"
                   width="85">
                   </el-table-column>
                 
                   <el-table-column
                   prop="price"
                   label="检测费"
                   width="70">
                   </el-table-column>
                   <el-table-column
                   prop="status"
                   label="状态"
                   width="75">
                   </el-table-column>
                   <el-table-column
                   prop="getdate"
                   label="就诊日期"
                   width="90">
                   </el-table-column>
                   <el-table-column
                   prop="gettime"
                   label="就诊时间"
                   width="70">
                   </el-table-column>
                   <el-table-column
                   prop="time"
                   label="预约时间"
                   width="140">
                   </el-table-column>
                   <el-table-column  prop="imgs" label="操作" width="80">
                       <template slot-scope="scope">
                           <i @click="testDetail" class="book el-icon-s-order"></i>
                       </template>
                   </el-table-column>
               </el-table>
           </div>
           <div class="allpage">
            <Pages></Pages>
           </div>
       </div>

   
   </div>
</template>
 
 <script>
import Pages from '@/components/Pages.vue';

 
 export default {
   name: 'TestView',
   components:{Pages},
   data () {
     return {
       tableData: [{
           name: 'xxx',
           card:5000909000,
           bodycard:371890199507070909,
           phone: 190000678123,
           home:'内科-肾内科',
           price:60.00,
           status:'已就诊',
           getdate: '2016-05-03',
           gettime:'9:30',
           time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }, 
       {
         name: 'xxx',
         card:5000909000,
         bodycard:371890199507070909,
         phone: 190000678123,
         home:'内科-肾内科',
         price:60.00,
         status:'已就诊',
         getdate: '2016-05-03',
         gettime:'9:30',
         time:'2019-08-15 14:02:26'
       }
   ],
       multipleSelection: [],
       radio: '4',
       shortcuts: [{
           text: '最近一周',
           onClick(picker) {
             const end = new Date();
             const start = new Date();
             start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
             picker.$emit('pick', [start, end]);
           }
         }, {
           text: '最近一个月',
           onClick(picker) {
             const end = new Date();
             const start = new Date();
             start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
             picker.$emit('pick', [start, end]);
           }
         }, {
           text: '最近三个月',
           onClick(picker) {
             const end = new Date();
             const start = new Date();
             start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
             picker.$emit('pick', [start, end]);
           }
         }],
       value1: '',
     };
   },
   methods: {
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
     testDetail(){
        if(this.$route.name!='testdetail'){
          this.$router.push('/testdetail')
        }    
      },
   }

 }
 </script>
 
 <!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
 .coments{
   padding: 0 0 0 10px;
   box-sizing: border-box;
 }
 .top{
   display: flex;
   align-items: center;
   justify-content: space-between;
   position: relative;
 }
h2{
   height: 30px;
   line-height: 30px;
   font-weight: 400;
   font-style: normal;
   font-size: 18px;
   margin-left: 30px;
}
h2::after{
   content: '';
   border-width: 0px;
   position: absolute;
   left: 0px;
   top:12px;
   width: 24px;
   height: 8px;
   border-radius: 10px;
   background-color: #006EFF;
}
.topright{
   display: flex;
}
.import,.out{
   background-color: rgba(0, 110, 255, 0.0980392156862745);
   border: none;
   border-radius: 4px;
   box-shadow: none;
   font-weight: 400;
   font-size: 14px;
   font-style: normal;
   letter-spacing: 1px;
   color: #006EFF;
   padding: 8px 18px;
   box-sizing: border-box;
   margin-left: 20px;
}
.import:hover,.out:hover{
   background-color: #4e7dff;
   color: #fff;
}
.allnumber{
   width: 100%;
   /* height: 781px; */
   background: inherit;
   background-color: rgba(255, 255, 255, 1);
   border-radius: 8px;
   box-shadow: 0px 0px 20px rgba(215, 215, 215, 1);
   margin-top: 20px;
   padding: 15px;
   box-sizing: border-box;
}
.alltop{
   display: flex;
   align-items: center;
   /* justify-content: space-between; */
   margin:0 0 20px;
}
.el-radio__label {
   padding-left: 5px;
}
.el-radio {
   color: #606266;
   font-weight: 500;
   line-height: 1;
   cursor: pointer;
   white-space: nowrap;
   outline: 0;
   margin-right: 15px;
}
.el-date-editor--daterange.el-input__inner{
   width:260px;
}
.block{
	display: flex;
    position: relative;
	margin-left: 40px;
}
/* .el-picker-panel {
   position: absolute;
   top: 175px;
   left: 531px;
   transform-origin: center top;
   z-index: 2001;
} */

.button{
   padding:10px 13px;
   box-sizing: border-box;
   border-radius: 8px;
   color: #fff;
   font-size: 14px;
   background-color: rgba(0, 110, 255, 1);
   margin-left: 10px;
}
.allpage{
   display: flex;
   justify-content: end;
   padding-top: 20px;
   box-sizing: border-box;
}
.el-table thead {
   font-weight: 400;
   font-style: normal;
   font-size: 12px;
   color: #999999;
}
.el-table {
   font-size: 12px;
   color: #606266;
}
.book{
   font-size: 25px;
   color: #3b70ff;
}
::v-deep .el-table th.el-table__cell>.cell{
  padding-left: 14px;
}
</style>